<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/vue.global.js"></script>
    <title>条件渲染</title>
</head>
<body>

    <div id="app">
        <Button @click="toggle()">切换</Button>
        <h1 v-if="awesome == 1">Vue is awesome!😉</h1>
        <h1 v-else-if="awesome == 2">卧槽！😫</h1>
        <h1 v-else>哈哈，逆天🤣</h1>
        <br>
        <br>
        <h1 v-show="awesome == 1">Vue is awesome!😉</h1>
        <h1 v-show="awesome == 2">卧槽！😫</h1>
        <h1 v-show="awesome == 0 ">哈哈，逆天🤣 ☞ 🤡</h1>
    </div>

    <script>
        const myApp = {
            data() {
                return {
                    awesome:0
                }
            },
            methods:
            {
                toggle()
                {
                    this.awesome = (this.awesome + 1) % 3;
                }
            }
        }

        Vue.createApp(myApp).mount("#app");
    </script>
</body>
</html>